package com.learning.spring.data.dao.exception.service.impl;

import com.learning.spring.data.dao.exception.annotation.LogEntity;
import com.learning.spring.data.dao.exception.entity.User;
import com.learning.spring.data.dao.exception.service.AopService;

/**
 * ClassName: AopServiceImpl
 * Description: 业务方法
 * Date: 2019/4/21 15:35 【需求编号】
 *
 * @author Sam Sho
 * @version V1.0.0
 */
@LogEntity
public class AopServiceImpl implements AopService {

    @LogEntity
    @Override
    public void annotation(String name) {
        System.out.println("** 操作【注解】的业务** " + name);
    }

    @Override
    public void add(String name) {
        System.out.println("** 操作【新增】的业务** " + name);
    }

    @Override
    public void update(String name) {
        System.out.println("** 操作【修改】的业务** " + name);
    }

    @Override
    public void select(User user) {
        System.out.println("** 操作【查询】的业务** " + user);
    }

    @Override
    public void exception(String name) {
        System.out.println("** 操作【异常】的业务** " + name);
        int i = 1 / 0;
    }

    @Override
    public String execute() {
        System.out.println("** 操作【执行】有返回业务** ");
        return "RETURN";
    }

    @Override
    public void scan(String name) {
        System.out.println("** 操作【扫描】的业务** " + name);
    }

    public void self(String name) {
        System.out.println("** 操作【私有】的方法** " + name);
    }
}
